<%= index_field_wrapper(**field_wrapper_args, flush: flush?) do %>
  <% if @field.value.present? %>
    <% if @field.value.attached? && @field.value.representable? && @field.is_image %>
      <%= link_to_if @field.link_to_record, image_tag(helpers.main_app.url_for(@field.value), class: 'h-10'), resource_view_path, class: 'block' %>
    <% elsif @field.value.attached? && @field.is_audio %>
      <%= link_to_if @field.link_to_record, audio_tag(helpers.main_app.url_for(@field.value), controls: true, preload: false, class: 'max-h-full h-10'), resource_view_path, class: 'block h-8' %>
    <% else %>
      <%= @field.value.filename %>
    <% end %>
  <% else %>
    —
  <% end %>
<% end %>
